import gtk, conf
from engine import Widgets
from abcommon import *

class UI(Widgets):
	
	def __init__(self, *args):
		#super(UI, self).__init__()
		Widgets.__init__(self)
		
		self.changeXMLtree(conf.ABOUT_DIALOG)
		self.__widget = self.XMLtree.getWidget(conf.ABOUT_DIALOG)
		self.__set(
			icon	= conf.DATA_DIR +"/img/logo_minimal.png", 
			name 	= conf.APP_NAME, 
			version = conf.APP_VERSION, 
			logo	= gtk.gdk.pixbuf_new_from_file(conf.DATA_DIR +"/img/logo_medium.png"), 
			license = conf.LICENSE)
		self.__mainLoop()
		
	def __set(self, icon, name, version, logo, license):
		self.__widget.set_icon_from_file(icon)
		self.__widget.set_name(name)	
		self.__widget.set_version(version)
		self.__widget.set_logo(logo)
		self.__widget.set_license(license)

	def __mainLoop(self):
		self.__widget.run()
		self.__widget.destroy()